package ru.study.thinkin.chapter8;

class Useful {
	public void f() {}
	public void g() {}
}
class MoreUseful extends Useful {
	public void f() {}
	public void g() {}
	public void u() {System.out.println("Ye");}
	public void v() {}	
}

public class RTTI { 

	public static void main(String[] args) {
		Useful[] x ={new Useful(),new MoreUseful()};
		x[0].f();
		x[1].g();
		
		for (Useful item : x ) {
			if(item instanceof MoreUseful){
				((MoreUseful)x[1]).u();
			}
		}	
		
	}
}
